import request from '@/utils/request'

export function create(data) {
  return request({
    url: '/api/v1/SysBusinessSupplier/Create',
    method: 'post',
    data
  })
}

export function deleteRecord(data) {
  return request({
    url: '/api/v1/SysBusinessSupplier/Delete',
    method: 'delete',
    data
  })
}

export function deleteRange(data) {
  return request({
    url: '/api/v1/SysBusinessSupplier/Delete',
    method: 'delete',
    data
  })
}
export function update(data) {
  return request({
    url: '/api/v1/SysBusinessSupplier/Update',
    method: 'post',
    data
  })
}

export function getList(data, pagination) {
  if (pagination) {
    data["pageIndex"] = pagination.pageIndex;
    data["pageSize"] = pagination.pageSize;
  }
  return request({
    url: '/api/v1/SysBusinessSupplier/GetList',
    method: 'get',
    params: data
  })
}

export function getListNoPage(data, pagination) {
  return request({
    url: '/api/v1/SysBusinessSupplier/GetListNoPage',
    method: 'get',
    params: data
  })
}

export const get = params => request('/api/v1/SysBusinessSupplier/Get', { params });
// 状态
export const Status = {
  1: '启用',
  2: '禁用',
}
export const Opinion = {
  0: '未评定',
  1: '合格',
  2: '不合格',
}
export function LatelySupplierEvaluationGet(data) {
  return request({
    url: '/api/v1/Evaluation/LatelySupplierEvaluationGet',
    method: 'get',
    params: data
  })
}

export function SupplierEvaluationGetList(data, pagination) {
  if (pagination) {
    data["pageIndex"] = pagination.pageIndex;
    data["pageSize"] = pagination.pageSize;
  }
  return request({
    url: '/api/v1/Evaluation/SupplierEvaluationGetList',
    method: 'get',
    params: data
  })
}
